<template>
  <component :is="tag" :class="sliderClass">
    <slot></slot>
  </component>
</template>
<script setup>
import { useSwiper } from "./index";
import { defineProps, onMounted, ref } from "vue";
const sliderClass = ref("swiper-slide");
const swiper = useSwiper();
defineProps({
  tag: {
    type: String,
    default: "div",
  },
});
onMounted(() => {
  // 更新swiper
  if (swiper && swiper.value) {
    setTimeout(() => {
      swiper.value.update();
    }, 500);
  }
});
</script>
<style scoped lang="less"></style>
